<% if session[:user] %>
 <ul id="top_menu">
  <li><%= link_to "logout", :controller => 'user', :action => 'logout' %></li>
  <li>Logged in as <%= link_to session[:user].username, :controller => 'user', :action => 'my_account' %></li>
 </ul> 
<% end %>
